﻿/* ######################################## *\
 * ### Copyright (C) 2009 AJ Ravindiran ### *
\* ######################################## */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using AJRavindiran.Jolt.RuneScape.Models.Items;

namespace AJRavindiran.Jolt.RuneScape.Models
{
    /// <summary>
    /// Reresents management for item related models.
    /// </summary>
    public class ItemManager
    {
        #region Fields
        private Dictionary<int, ItemDefinition> itemDefinitions = new Dictionary<int, ItemDefinition>();
        #endregion Fields

        #region Constructors
        public ItemManager()
        {
            Jolt.GetLog().WriteInfo("Constructing item manager...");
            ItemDefinitionLoader.Load(itemDefinitions);
        }
        #endregion Constructors

        #region Methods
        /// <summary>
        /// Gets the item definition according to it's id.
        /// </summary>
        /// <param name="itemId">The item's id we want definitions for.</param>
        /// <returns>Retruns the definitions associated with the given item id.</returns>
        public ItemDefinition GetItemDefinition(int itemId)
        {
            return this.itemDefinitions[itemId];
        }
        #endregion Methods
    }
}
